Skip to content

fix: Linux NVIDIA tarball exceeds GitHub's 2 GiB asset limit - #222

Merged
thcp merged 1 commit into
mainfrom
fix/linux-nvidia-asset-size
Jun 24, 2026
Merged

fix: Linux NVIDIA tarball exceeds GitHub's 2 GiB asset limit#222
thcp merged 1 commit into
mainfrom
fix/linux-nvidia-asset-size

Conversation

@thcp

@thcp thcp commented Jun 24, 2026

Copy link
Copy Markdown
Collaborator

Problem

The Linux Release job built both variants successfully but failed at upload:

Validation Failed: ReleaseAsset size must be less than 2147483648

StemDeck-Linux-x64.NVIDIA.tar.gz exceeds GitHub's 2 GiB per-asset release limit.

Cause — a wrong assumption in the original NVIDIA design

We baked the project's default torch into the NVIDIA variant, assuming it mirrored the Windows NVIDIA package. But:

  • On Linux, the default PyPI torch wheel bundles the full CUDA runtime (~2.5 GB).
  • On Windows, the default wheel is CPU-only (that's why the Windows NVIDIA zip is only ~243 MB).

So the Windows NVIDIA package never baked CUDA — it ships CPU torch and downloads the CUDA wheel at first run via the desktop shell's install_cuda_torch (already cfg(not(macos)), so it covers Linux). Baking CUDA on Linux is fundamentally incompatible with GitHub releases.

Fix

Bake the small CPU torch in both variants. The NVIDIA variant differs only by omitting the cpu-only marker, so on first launch the shell detects the GPU and downloads the matching CUDA wheel — genuinely mirroring Windows. Both tarballs now stay well under 2 GiB.

  • make-portable.sh: always force the CPU torch wheel; marker stays CPU-only-conditional.
  • README-LINUX.txt: NVIDIA section now notes CUDA is downloaded on first run (needs internet + disk).

Validated

The failed run proved the rest of the pipeline works end-to-end: version step (post-#221), CPU build, NVIDIA build, and ClamAV scan all passed on the wsl2 runner — only the oversized upload failed.

🤖 Generated with Claude Code

The Linux NVIDIA tarball baked the full CUDA torch wheel, producing an
asset >2 GiB that GitHub release uploads reject (size must be < 2147483648).

On Linux the default PyPI torch wheel bundles the CUDA runtime (~2.5 GB),
unlike Windows where the default wheel is CPU-only. The Windows NVIDIA
package therefore never baked CUDA -- it ships CPU torch and downloads the
CUDA wheel at first run via the desktop shell (install_cuda_torch, which is
cfg(not(macos)) and already covers Linux). Mirror that on Linux: bake the
small CPU torch in both variants; the NVIDIA variant differs only by
omitting the cpu-only marker, so the shell detects the GPU and downloads
CUDA on first launch. Keeps both tarballs well under the 2 GiB limit.
@thcp
thcp merged commit 421f2b3 into main Jun 24, 2026
8 checks passed
@thcp
thcp deleted the fix/linux-nvidia-asset-size branch June 24, 2026 18:17
thcp added a commit that referenced this pull request Aug 25, 2026
)

* Ship the challenge solver without costing anyone a reinstall (#432, #438)

Extraction rides a fallback client that skips YouTube's signature/n-challenge.
It works today, yt-dlp has deprecated it, and fixing that needs two things:
the solver script and a JavaScript engine to run it.

The obvious route was a yt-dlp-ejs dependency and a binary in data/. Both
would have reached only fresh installs.

runtimeId is sha256(uv.lock) and the desktop updater stands down when it
changes, because it can replace backend/ but never python/. A new dependency
would therefore have sent every existing desktop install to a manual
reinstall. The in-app updater is something users have been told works;
spending that to ship a fix nobody has asked for is a bad trade.

So both halves go where the updater can reach them.

The solver is vendored into app/_vendor, which becomes backend/app/_vendor in
a package. 53 KB of pure Python that StemDeck never imports and yt-dlp
discovers at runtime, so it is a payload rather than a dependency, and it
belongs in the app layer. app/__init__ puts it on sys.path before anything
else, which is the only place that can work: yt-dlp resolves its optional
dependencies at import time and pipeline.download imports yt_dlp at module
level. uv.lock is untouched, so runtimeId does not move.

The engine goes to backend/jsruntime rather than data/jsruntime for the same
reason: the updater replaces backend/ and leaves data/ alone. quickjs-ng,
pinned by version and SHA256 like the macOS FFmpeg download (#172), fetched at
package time by all three build scripts. 2 MB against deno's 110 MB, against a
2 GiB asset cap this project has already hit (#318, #222).

Vendoring usually means remembering to update something.
scripts/update_vendored_ejs.py removes that: it exits non-zero when PyPI has a
newer release and takes it with --apply, verifying the wheel checksum first.

Verified with nothing pip-installed: the solver resolves from app/_vendor,
yt-dlp finds it, quickjs runs, and six audio formats resolve where the
solverless path found one.

Two things unchanged and already on the issues. The web client still fails for
want of a PO token yt-dlp cannot mint, so a flagged IP may still need cookies.
And the solver costs about 7.8 s per extraction, measured.

* Assert the build scripts and the runtime lookup still agree

A cross-language contract with nothing checking it. Three shell and PowerShell
scripts decide where the JS engine lands; Python decides where to look for it.
A mismatch does not fail a build or a test, it shows up as YouTube imports
quietly degrading on one platform, because yt-dlp just falls back to the
client that skips the challenge.

Two tests. One pins the packaged layout: in a package this file is
backend/app/core/config.py, so parents[2] is backend/, and a refactor of that
index would leave every desktop package without an engine. The other reads the
three scripts and asserts they still install into backend/ and still verify a
checksum before trusting the binary.

* Drop scripts/release_download_chart.py from this branch

Swept in by a careless 'git add scripts/'. It is unrelated work in progress
that was untracked before this branch started, and it belongs to whoever is
writing it, not to a change about YouTube's challenge solver. The file is
untouched on disk.

---------

Co-authored-by: Thales <>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant